﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using Bussiness.Service;
using Bussiness;

namespace KiwiShopping.Controllers
{
    public class ArticalController : BaseController
    {
        //
        // GET: /Artical/

        //public ActionResult DanhSachBaiViet()
        //{
        //    List<Article> list = new Artical_Service().getAll_Article();
        //    ViewData["ListArticles"] = list;
        //    return View();
        //}


        public ActionResult DanhSachBaiViet(int ID_Catelogy, int PageIndex)
        {
            List<Article> list = new Artical_Service().get_Article_By_idCatelogy_Paging(ID_Catelogy, PageIndex,12);
            ViewData["ListArticles"] = list;
            List<int> listPage = new Artical_Service().get_List_Page_Article(ID_Catelogy, 12);
            ViewData["ListPage"] = listPage;
            return View();
        }

        public ActionResult ChiTietBaiViet(int ID)
        {
            ViewData["ArticalDetail"] = new Artical_Service().getArticleByID(ID); ;
            return View();
        }


    }
}
